package io.renren.service.impl;

import io.renren.entity.CourseEntity;
import io.renren.entity.CourseuserVOEntity;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;


import io.renren.dao.CourseuserDao;
import io.renren.entity.CourseuserEntity;
import io.renren.service.CourseuserService;

import java.sql.Timestamp;
import java.util.*;


@Service("courseuserService")
public class CourseuserServiceImpl extends ServiceImpl<CourseuserDao, CourseuserEntity> implements CourseuserService {

    @Override
    public List<CourseuserEntity> getCourseUser(Integer userid){
        List<CourseuserEntity> list = baseMapper.getCourseUser(userid);
        return list;
    }

    @Override
    public void addCourse(Integer userid,Integer courseid,Timestamp time){
        baseMapper.addCourse(userid,courseid,time);
    }

    @Override
    public List<CourseEntity> getCanAddCourse(Integer userid){
        List<CourseEntity> list = baseMapper.getCanAddCourse(userid);
        return list;
    }

    @Override
    public List<CourseuserVOEntity> getStudentAnswerList(Integer courseid,Integer classtimeid){
        List<CourseuserVOEntity> list = baseMapper.getStudentAnswerList(courseid,classtimeid);
        return list;
    }

    @Override
    public List<CourseuserEntity> getMyCourse(@Param("userid") Integer userid){
        List<CourseuserEntity> list = baseMapper.getMyCourse(userid);
        return list;
    }
}
